All Questions
3 questions
0votes
1answer
217views
Which types of objects that are instantiated inside controller's methods should be injected into the controller instead?
Consider code below MyController //MyAction //MyHandler { public function processRequest() { // ... $myObject = new MyObjectClass(); $myObject->methodCall(); ...
2votes
1answer
731views
How far do I separate Model code from Controller code when writing MVC?
I have some code where Controller depends on the Model, and in my case Model acts like a Database Access Object. use FQDN\Model; class Controller { /** @var FQDN\Model */ private $model; ...
0votes
1answer
716views
Practical Use of Depency Injection (IoC) Container
I am creating a MVC-ish framework in PHP. I am trying to implement a DI Container to allow the creation of controller objects (among others). My MVC framework is pretty typical. Each module (or ...